package cn.shop.dys.activity;
 /*import cn.shop.dys.R;
import kankan.wheel.widget.OnWheelChangedListener;
import kankan.wheel.widget.WheelView;
import kankan.wheel.widget.adapters.ArrayWheelAdapter;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

import com.mrwujay.cascade.activity.BaseActivity;

public class TestActivity extends BaseActivity implements OnClickListener, OnWheelChangedListener {
   private WheelView mViewProvince;
    private WheelView mViewCity;
    private WheelView mViewDistrict;
    private Button mBtnConfirm;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.address_list_add_dialog);
        setUpViews();
        setUpListener();
        setUpData();
    }

    private void setUpViews() {
        mViewProvince = (WheelView) findViewById(R.id.id_province);
        mViewCity = (WheelView) findViewById(R.id.id_city);
        mViewDistrict = (WheelView) findViewById(R.id.id_district);
      //  mBtnConfirm = (Button) findViewById(R.id.btn_confirm);
    }

    private void setUpListener() {
        // 添加change事件
        mViewProvince.addChangingListener(this);
        // 添加change事件
        mViewCity.addChangingListener(this);
        // 添加change事件
        mViewDistrict.addChangingListener(this);
        // 添加onclick事件
    //    mBtnConfirm.setOnClickListener(this);
    }

    private void setUpData() {
        initProvinceDatas();
        mViewProvince.setViewAdapter(new ArrayWheelAdapter<String>(TestActivity.this, mProvinceDatas));
        // 设置可见条目数量
        mViewProvince.setVisibleItems(7);
        mViewCity.setVisibleItems(7);
        mViewDistrict.setVisibleItems(7);
        updateCities();
        updateAreas();
    }

    @Override
    public void onChanged(WheelView wheel, int oldValue, int newValue) {
        // TODO Auto-generated method stub
        if (wheel == mViewProvince) {
            updateCities();
        } else if (wheel == mViewCity) {
            updateAreas();
        } else if (wheel == mViewDistrict) {
            mCurrentDistrictName = mDistrictDatasMap.get(mCurrentCityName)[newValue];
            mCurrentZipCode = mZipcodeDatasMap.get(mCurrentDistrictName);
        }
    }

    *//**
     * 根据当前的市，更新区WheelView的信息
     *//*
    private void updateAreas() {
        int pCurrent = mViewCity.getCurrentItem();
        mCurrentCityName = mCitisDatasMap.get(mCurrentProviceName)[pCurrent];
        String[] areas = mDistrictDatasMap.get(mCurrentCityName);

        if (areas == null) {
            areas = new String[] { "" };
        }
        mViewDistrict.setViewAdapter(new ArrayWheelAdapter<String>(this, areas));
        mViewDistrict.setCurrentItem(0);
    }

    *//**
     * 根据当前的省，更新市WheelView的信息
     *//*
    private void updateCities() {
        int pCurrent = mViewProvince.getCurrentItem();
        mCurrentProviceName = mProvinceDatas[pCurrent];
        String[] cities = mCitisDatasMap.get(mCurrentProviceName);
        if (cities == null) {
            cities = new String[] { "" };
        }
        mViewCity.setViewAdapter(new ArrayWheelAdapter<String>(this, cities));
        mViewCity.setCurrentItem(0);
        updateAreas();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
			*//*case R.id.btn_confirm:
				showSelectedResult();
				break;*//*
            default:
                break;
        }
    }

    private void showSelectedResult() {
        Toast.makeText(TestActivity.this, "当前选中:"+mCurrentProviceName+","+mCurrentCityName+","
                +mCurrentDistrictName+","+mCurrentZipCode, Toast.LENGTH_SHORT).show();
    }
}*/

import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.ScaleAnimation;
import android.view.animation.Transformation;
import android.view.animation.TranslateAnimation;
import android.widget.Toast;
import android.content.Context;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.WindowManager;
import android.widget.Toast;
import cn.shop.dys.widget.RollMenuView;
import cn.shop.dys.R;


/**
 *
 * 测试
 * Created by sunjian on 2016/4/18.
 *
 */

public class TestActivity extends AppCompatActivity {

    private RollMenuView menuView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);
        //  setView();

/* ButtonEditText bet= (ButtonEditText) findViewById(R.id.bet);
        bet.setOnButtonClickListener(new ButtonEditText.OnButtonClickListener() {
            @Override
            public void onButtonClick(View view) {
                Toast.makeText(TestActivity.this,"被点了",Toast.LENGTH_SHORT).show();
            }
        });*//*

//        bet.getButton().setOnClickListener(this);
    }


    */
    }
    public void click(View v) {
        // Toast.makeText(this,"被点了",Toast.LENGTH_SHORT).show();
        WindowManager mWm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
        WindowManager.LayoutParams params = new WindowManager.LayoutParams();
        params.height = WindowManager.LayoutParams.WRAP_CONTENT;
        params.width = WindowManager.LayoutParams.WRAP_CONTENT;
        params.format = PixelFormat.TRANSLUCENT;
        menuView = new RollMenuView(this);
        menuView.setInitLoaction(200,300);
        menuView.setOnRollMenuViewListener(new RollMenuView.OnRollMenuViewListener() {
            @Override
            public void finish() {
                /*AnimationSet set=new AnimationSet(false);
                ScaleAnimation sa=new ScaleAnimation(1.0f, 0, 1.0f, 0,
                        Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
                sa.setDuration(300);
                sa.setFillAfter(true);
                *//*TranslateAnimation ta=new TranslateAnimation(Animation.RELATIVE_TO_SELF,0,Animation.RELATIVE_TO_PARENT,0,Animation.RELATIVE_TO_SELF,0,Animation.RELATIVE_TO_PARENT,0);
                ta.setFillAfter(true);
                ta.setDuration(500);
                set.addAnimation(sa);
                set.addAnimation(ta);*//*
                menuView.setAnimation(sa);*/
                /*AnimationSet set=new AnimationSet(false);
                ObjectAnimator oa=ObjectAnimator.ofFloat(menuView,"scaleX",1.0f,0);
                ObjectAnimator sa=ObjectAnimator.ofFloat(menuView,"scaleY",1.0f,0);
                oa.setDuration(1000);
                sa.setDuration(1000);
                set.addAnimation(oa);*/
                ObjectAnimator anim = ObjectAnimator//
                        .ofFloat(menuView, "zhy", 1.0F,  0.0F)//
                        .setDuration(5000);//
                anim.start();
                anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener()
                {
                    @Override
                    public void onAnimationUpdate(ValueAnimator animation)
                    {
                        float cVal = (Float) animation.getAnimatedValue();
                        menuView.setAlpha(cVal);
                        menuView.setScaleX(cVal);
                        menuView.setScaleY(cVal);
                    }
                });
                Toast.makeText(TestActivity.this, "结束了", Toast.LENGTH_SHORT).show();
            }
        });
        //  TestView menuView=new TestView(this);
        mWm.addView(menuView, params);
        menuView.startAnim();
    }
}

/* public void click1(View view){

    }*//*

  */
/* private void setView()
   {
       LinearLayout linearLayout1 = (LinearLayout)findViewById(R.id.linearLayout1);
       LinearLayout linearLayout2 = (LinearLayout)findViewById(R.id.linearLayout2);
       Button button1 = (Button)findViewById(R.id.button1);
       Button button2 = (Button)findViewById(R.id.button2);
       final TextView textView = (TextView)findViewById(R.id.textView);
       final AddAndSubView addAndSubView1 = new AddAndSubView(TestActivity.this, 5);
       final AddAndSubView addAndSubView2 = new AddAndSubView(TestActivity.this);

       linearLayout1.addView(addAndSubView1);
       linearLayout2.addView(addAndSubView2);


       button1.setOnClickListener(new View.OnClickListener()
       {

           @Override
           public void onClick(View v)
           {
               addAndSubView1.setNum(30);
           }
       });


       button2.setOnClickListener(new View.OnClickListener()
       {

           @Override
           public void onClick(View v)
           {
               Toast.makeText(TestActivity.this, "数值为：" + addAndSubView1.getNum(), Toast.LENGTH_SHORT).show();
           }
       });


       //设置监听EditText内数值变化
       addAndSubView2.setOnNumChangeListener(new AddAndSubView.OnNumChangeListener()
       {

           @Override
           public void onNumChange(View view, int num)
           {
               textView.setText(Integer.toString(num));
           }
       });

   }*//*

}
*/
